package com.zhaoyd.uaademo.controller;

import com.github.pagehelper.PageHelper;
import com.zhaoyd.uaademo.config.security.SessionUserUtils;
import com.zhaoyd.uaademo.core.BaseLogger;
import com.zhaoyd.uaademo.entity.SysUser;
import com.zhaoyd.uaademo.service.SysUserService;
import org.springframework.security.core.userdetails.User;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author zhaoyd
 * @date 2020-10-28
 */
@RestController
public class SysUserController extends BaseLogger {
    @Resource
    private SysUserService sysUserService;

    @RequestMapping("test")
    public Object test(){
        PageHelper.startPage(1,20);
        List<SysUser> list = sysUserService.listAll();
        SysUser user = SessionUserUtils.getCurrentUser();
        return list;
    }

}
